package top.lyc829.zzl_android.ui.message.system;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.DraggableModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.xuexiang.xutil.data.DateUtils;

import org.jetbrains.annotations.NotNull;

import top.lyc829.zzl_android.R;
import top.lyc829.zzl_android.logic.bean.NoticeSystemBean;

public class NoticeSystemAdapter extends BaseQuickAdapter<NoticeSystemBean, BaseViewHolder> implements DraggableModule {
    public NoticeSystemAdapter() {
        super(R.layout.notice_system_item);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, NoticeSystemBean noticeSystemBean) {
        baseViewHolder.setText(R.id.notice_system_title, noticeSystemBean.getTitle());
        baseViewHolder.setText(R.id.notice_system_content, noticeSystemBean.getContent());
        long time = Long.parseLong(noticeSystemBean.getPutTime() + "000");
        baseViewHolder.setText(R.id.notice_system_time, DateUtils.getFuzzyTimeDescriptionByNow(time));
    }
}
